#include<cmath>
#include<cstdio>
#include<string>
#include<cstring>
#include<iostream>
#include<algorithm>
#define re register int
using namespace std;
inline int read(){
	int x=0,w=1;
	char ch=getchar();
	while(ch!='-'&&(ch<'0'||ch>'9')) ch=getchar();
	if(ch=='-') w=-1,ch=getchar();
	while(ch>='0'&&ch<='9') x=(x<<1)+(x<<3)+ch-48,ch=getchar();
	return x*w;
}
int main(){
	//freopen("950a.in","r",stdin);
	//freopen("950a.out","w",stdout);
	int l,r,a,ans=0;
	l=read();r=read();a=read();
	int k=min(l,r);
	ans+=k;
	l-=k;r-=k;
	k=max(l,r);
	int b=min(k,a);
	ans+=b;
	a-=b;k-=b;
	if(k==0) {ans+=(a/2);printf("%d\n",ans*2);return 0;}
	else {printf("%d\n",ans*2);return 0;}
	return 0;
}
